Socket
Socket
Sign inDemoInstall

minivents

Package Overview
Dependencies
0
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    minivents

Tiny eventing for javascript


Version published
Weekly downloads
408
decreased by-10.53%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

minivents Build Status

http://allouis.github.io/minivents/

API

on : Listen to event. Params { type:String, callback:Function | context:Object }. Returns target.

off : Stop listening to event. Params { type:String | callback:Function }. Returns target.

emit: Emit event. Params { type:String | data:Object }. Returns target.

Constructor Example

var sandbox = new Events();
    
sandbox.on("event", function(){
    // do stuff
});

sandbox.emit("event"); //does stuff

sandbox.off("event");

sandbox.emit("event"); //does not do stuff

Mixin Example

var sandbox = {
    otherStuff: true
};

Events(sandbox);

sandbox.on("event", function(){
    // do stuff
});

sandbox.emit("event"); //does stuff

sandbox.off("event");

sandbox.emit("event"); //does not do stuff

Keywords

FAQs

Last updated on 29 Mar 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc